package io;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class CopDemo2 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis=new FileInputStream("image.png");
        FileOutputStream fos=new FileOutputStream("image3.png");
        int len;
        byte[] bata=new byte[1024*10];//10k
        long start=System.currentTimeMillis();
        while((len=fis.read(bata))!=-1){
            fos.write(bata,0,len);
        }
        long end=System.currentTimeMillis();
        System.out.println("复制完成，耗时："+(end-start)+"毫秒");

        fos.close();
        fis.close();
    }
}
